package cn.signalpha.modules.shop.entity;

import cn.signalpha.core.swagger.ApiModelPropertyEnum;
import cn.signalpha.modules.pay.enums.PayTypeEnum;
import cn.signalpha.modules.shop.entity.enums.OrderTypeEnum;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * 实体类
 *
 * @author signalpha
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("shop_order_refund")
@ApiModel(value = "OrderRefund对象", description = "订单退换货")
public class OrderRefund implements Serializable {

    private static final long serialVersionUID = 1L;

	@TableId(value = "id", type = IdType.ASSIGN_ID)
	@JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "主键")
    private Long id;

    @ApiModelProperty(value = "商户id")
    private Long sellerId;

    @ApiModelProperty(value = "买家id")
    private Long userId;

	@ApiModelProperty(value = "支付类型")
	@ApiModelPropertyEnum(PayTypeEnum.class)
	private String payType;

	@ApiModelProperty(value = "支付单号")
	private String payNo;

	@ApiModelProperty(value = "外部支付单号")
	private String payBizNo;

    @ApiModelProperty(value = "订单id")
    private Long orderId;

	@ApiModelProperty(value = "订单号")
	private String orderNo;

	@ApiModelProperty(value = "订单类型")
	@ApiModelPropertyEnum(OrderTypeEnum.class)
	private Integer orderType;

	@ApiModelProperty(value = "订单详情id")
	private Long orderDetailId;

	@ApiModelProperty(value = "商品id")
	private Long goodsId;

	@ApiModelProperty(value = "商品数量")
	private Integer goodsNum;

	@ApiModelProperty(value = "商品单价")
	private Double goodsPrice;

	@ApiModelProperty(value = "商品总价")
	private Double goodsPriceTotal;

	@ApiModelProperty(value = "商品状态：0未收到货 1已收到货")
	private Integer goodsStatus;

	@ApiModelProperty(value = "商品详情")
	@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
	private String goodsDetail;

	@ApiModelProperty(value = "售后单号")
	private String refundNo;

	@ApiModelProperty(value = "售后类型：1退款 2退款退货")
	private Integer refundType;

	@ApiModelProperty(value = "第三方退款单号")
	private String refundBizNo;

    @ApiModelProperty(value = "售后状态: -2用户取消 -1商家拒绝 0待审核 1商家同意 2用户寄回 3商家确认")
    private Integer refundStatus;

	@ApiModelProperty(value = "售后状态路径")
	private String refundStatusPath;

	@ApiModelProperty(value = "退款金额")
	private Double refundMoney;

    @ApiModelProperty(value = "售后退款状态: -1退款失败 0未款退 1退款中 2退款成功")
    private Integer refundMoneyStatus;

	@ApiModelProperty(value = "退款余额")
	private Double returnDeductMoney;

	@ApiModelProperty(value = "退款积分")
	private Double returnDeductIntegral;

	@ApiModelProperty(value = "售后地址")
	@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
	private String refundAddress;

	@ApiModelProperty(value = "物流类型：1快递物流 2到店退货")
	private Integer logisticsType;

	@ApiModelProperty(value = "物流单号")
	private String logisticsNo;

	@ApiModelProperty(value = "物流名称")
	private String logisticsName;

    @ApiModelProperty(value = "文件凭证")
    private String buyerImg;

    @ApiModelProperty(value = "申请原因")
    private String buyerMsg;

    @ApiModelProperty(value = "卖家备注")
    private String sellerMsg;

	@ApiModelProperty(value = "申请时间")
	private Date createTime;

	@ApiModelProperty(value = "卖家处理时间")
	private Date handelTime;

	@ApiModelProperty(value = "退款时间")
	private Date refundTime;

}
